import os
from langchain_openai import  ChatOpenAI

# 设置HTTP和HTTPS代理服务器地址
os.environ["http_proxy"] = "127.0.0.1:8888"
os.environ["https_proxy"] ="127.0.0.1:8888"
# 设置模型名称，模型密钥，模型地址
model = ChatOpenAI(model="deepseek-chat",api_key= "你的密钥",base_url= "https://api.deepseek.com")

def chat(message: str):
    msg = [
        {
            "role": "user",
            "content": message
        }
    ]
    result = model.invoke(msg).content
    return result